using System;
using System.Web.Configuration;
using Avanzis.QueryFramework;

namespace Avanzis.QueryObjects
{
    /// <summary>
    /// QueryObjects configuration
    /// </summary>
    public class QueryObjectsConfiguration
    {
        private static String connectionString;

        /// <summary>
        /// Gets or sets the connection string.
        /// </summary>
        /// <value>The connection string.</value>
        public static string ConnectionString
        {
            get
            {
                if (connectionString == null)
                {
                    connectionString = WebConfigurationManager.ConnectionStrings["QueryObjects"].ConnectionString;
                }
                return connectionString;
            }
            set
            {
                connectionString = value;
            }
        }

        /// <summary>
        /// Gets or sets the used dialect
        /// </summary>
        /// <value>The dialects.</value>
        public static Dialects Dialect
        {
            get { return QueryFrameworkConfiguration.Dialect;  }
            set { QueryFrameworkConfiguration.Dialect = value; } 
        }

        /// <summary>
        /// Gets or sets a value indicating whether [dialect allows offset].
        /// </summary>
        /// <value><c>true</c> if [dialect allows offset]; otherwise, <c>false</c>.</value>
        public static bool DialectAllowsOffset
        {
            get { return QueryFrameworkConfiguration.DialectAllowsOffset; }            
        }    

    }
    
}
